From 4febb119814c1194ccf5a42833a4c54672cbd1aa Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Thu, 22 Feb 2001 13:29:37 +0000 Subject: [PATCH] (texinfo-format-scan): Signal an error if @ follows an accent command such as @'. Support optional braces in commands that insert accents, like makeinfo does. --- lisp/textmodes/texinfmt.el | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/lisp/textmodes/texinfmt.el b/lisp/textmodes/texinfmt.el index 822631e039b..0441602b3a7 100644 --- a/lisp/textmodes/texinfmt.el +++ b/lisp/textmodes/texinfmt.el @@ -868,7 +868,23 @@ lower types.") ;; Otherwise: the other characters are simply quoted. Delete the @. (t (delete-char -1) - (forward-char 1))) + ;; Be compatible with makeinfo: if @' and its ild are + ;; followed by a @ without a brace, barf. + (if (looking-at "[\"'^`~=]") + (progn + (if (= (char-after (1+ (point))) ?@) + (error "Use braces to give a command as an argument to @%c" + (following-char))) + (forward-char 1) + ;; @' etc. can optionally accept their argument in + ;; braces (makeinfo supports that). + (when (looking-at "{") + (let ((start (point))) + (forward-list 1) + (delete-char -1) + (goto-char start) + (delete-char 1)))) + (forward-char 1)))) ;; @ is followed by a command-word; find the end of the word. (setq texinfo-command-start (1- (point))) (if (= (char-syntax (following-char)) ?w) -- 2.30.2